package com.by.common.utils;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class DateUtils {
    /**
     * 返回系统日期yyyy-MM-dd
     *
     * @return
     */
    public static String getYMD() {
        LocalDate localDate = LocalDate.now();
        return localDate.format(DateTimeFormatter.ISO_LOCAL_DATE);
    }

    /**
     * 返回系统时间  yyyyMMddHHmmss
     * @return
     */

    public static String getSystemTime(){
        LocalDateTime time=LocalDateTime.now();
        return time.format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"));
    }

    public static void main(String[] args) {
        System.out.println(getSystemTime());
    }
}
